<?php
namespace App\Repositories;

use App\Helper\Utils;
use App\Traits\SingletonTrait;
use Hyperf\DbConnection\Db;

class UserRepository extends AbstractRepository
{
    use SingletonTrait;
    public function model()
    {
        return 'App\Model\User';
    }

    public function getBaseInfo($id){
        $user=$this->model()::query()->select('id','username','avatar','mobile')->withTrashed()->with(['wechat'=>function($q){
            $q->select('wx_nickname','wx_avatar','user_id')->withTrashed();
        }])->find($id);
        return $user;
    }
}